﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OsuTool
{
    class OsuFileInfo
    {
        private static readonly List<List<int>> KeyPosition = new List<List<int>>()
        {
            new List<int>() {64, 192, 320, 448},
            new List<int>() {51, 153, 256, 358, 460},
            new List<int>() {42, 128, 213, 298, 384, 469},
            new List<int>() {36, 109, 182, 256, 329, 402, 475},
            new List<int>() {32, 96, 160, 224, 288, 352, 416, 480},
            new List<int>() {28, 85, 142, 199, 312, 256, 369, 426, 483},
            new List<int>() {25, 76, 128, 179, 230, 281, 332, 384, 435, 486}
        };

        public static int KeyNumberToKeyPosition(int keyCount, int keyNumber)
        {
            if (keyCount < 4 || keyCount > 10)
            {
                throw new Exception("键数参数错误");
            }

            return KeyPosition[keyCount - 4][keyNumber];
        }

        public static int KeyPositionToKeyNumber(int keyCount, int keyPosition)
        {
            return KeyPosition[keyCount - 4].IndexOf(keyPosition) + 1;
        }


        public static readonly string StrCircleSize = "CircleSize";
        public static readonly string StrVersion = "Version";
        public static readonly string StrHitObjects = "[HitObjects]";
        public static readonly string StrNoLn = "No LN";
    }
}